package com.jml.springmvc.手写008.servlet.web.impl;


import com.jml.springmvc.手写008.servlet.DispatcherServlet;
import com.jml.springmvc.手写008.servlet.web.WebApplicationInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;


public class AbstractDispatcherServletInitializer implements WebApplicationInitializer {
	
	@Override
	public void onStartup(ServletContext servletContext) throws ServletException {
		// 1.开始注册我们的DispatcherServlet
		ServletRegistration.Dynamic dispatcherServlet =
                
                servletContext.addServlet("dispatcherServlet", new DispatcherServlet());
		
		dispatcherServlet.addMapping("/");// 拦截所有的请求
        dispatcherServlet.setLoadOnStartup(1);
	}
}
